import 'package:flutter/material.dart';

void main()=>runApp(MyApp());

class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      title: "首页",
      home: DefaultTabController(
          length: 3,
          child: new Scaffold(
              appBar: AppBar(
                title: Text("电影列表"),
                centerTitle: true,
                actions: <Widget>[
                  IconButton(
                    icon: Icon(Icons.search),
                    onPressed: (){},
                  )
                ],
              ),
              drawer: Drawer(
                child: ListView(
                  padding: EdgeInsets.all(0),
                  children: <Widget>[
                    UserAccountsDrawerHeader(
                      accountName: Text("测试账号"),
                      accountEmail: Text("tese@flutter.com"),
                      currentAccountPicture: CircleAvatar(
                        backgroundImage: NetworkImage("https://cdn.jsdelivr.net/gh/flutterchina/website@1.0/images/flutter-mark-square-100.png"),
                      ),
                    ),
                    ListTile(
                      title: Text("我的发布"),
                      trailing: Icon(Icons.send),
                    ),
                    ListTile(
                      title: Text("分享"),
                      trailing: Icon(Icons.share),
                    ),
                    ListTile(
                      title: Text("反馈"),
                      trailing: Icon(Icons.feedback),
                    ),
                    ListTile(
                      title: Text("退出登录"),
                      trailing: Icon(Icons.exit_to_app),
                    ),
                  ],
                ),
              ),
              bottomNavigationBar: Container(
                decoration: BoxDecoration(color: Colors.lightBlue),
                height: 50.0,
                child: TabBar(
                  labelStyle: TextStyle(fontSize: 10.0),
                  tabs: <Widget>[
                    Tab(icon: Icon(Icons.local_movies),text: "正在热映",),
                    Tab(icon: Icon(Icons.list),text: "即将上映",),
                    Tab(icon: Icon(Icons.timeline),text: "排行榜",),
                  ],
                ),
              )
          ),
      )
    );
  }

}